/**
 * @ClassName list
 * @Description TODO
 * @author Wenyi Luo
 * @date 22/2/24 10:15
 * @version: 1.0
 */

import java.util.ArrayList;
import java.util.List;


public class list {
    public static void main(String[] args) {

        List<String> arrayList = new ArrayList<>();
//        List<String> linkedList = new LinkedList<>();
        Long arrStart = System.currentTimeMillis();
        for (int i = 0; i < 100000; ++i) {
            arrayList.add(0,i+"");
        }
        Long arrTime = System.currentTimeMillis() - arrStart;
        System.out.println(arrTime-arrStart);
//
//        System.out.println("ArrayList的for循环遍历耗时:"+arrTime+"ms");
//        Long linkedStart = System.currentTimeMillis();


//        for (int i = 0; i < 1000000; ++i) {
//            linkedList.add(0,i+"");
//        }
//        Long linkedTime = System.currentTimeMillis() - linkedStart;
//        System.out.println("LinkedList的for循环遍历耗时:"+linkedTime+"ms");

    }

}

